#include <stdio.h>

int main()
{
	int x = 0;
	scanf("%d", &x);
	float b = 0;
	if ( x >= 0 && x < 5 ) {
		b = x + 2.5;
	}
	else if ( x >= 5 && x < 10 ) {
		b = 2 - 1.5 * ( x - 3) * (x - 3);
	}
	else if ( x >= 10 && x < 20 ) {
		b = x / 2.0 - 1.5;
	}
	printf("%.3f", b);
	return 0;
} 
